<template>
	<view class="content">
		<view class="info">
			<view class="info1">
				<text>姓名</text>
				<input type="text" v-model="name" value="" placeholder="请输入姓名" placeholder-class="inputStyle" />
			</view>
			<view class="info1">
				<text>车辆信息</text>
				<input type="text" v-model="vehInfo" value="" placeholder="请输入车辆信息" placeholder-class="inputStyle" @ />
			</view>
			<view class="info1">
				<text>手机号码</text>
				<input type="number" v-model="mobilePhnNum" value="" placeholder="请输入手机号码" placeholder-class="inputStyle" />
			</view>
		</view>

		<view class="confirmUpload" @click="confirmUp">确认上传</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			name: '',
			vehInfo: '',
			mobilePhnNum: '',
		};
	},
	onLoad() {},
	methods: {
		async confirmUp() {
			if (!this.name) return uni.$showMsg('请输入姓名');
			if (!this.vehInfo) return uni.$showMsg('请输入车辆信息');

			let mobileReg = /^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\d{8}$/;
			if (!mobileReg.test(this.mobilePhnNum)) return uni.$showMsg('请输入正确手机号');

			let obj = {
				uid: getApp().globalData.uid,
				name: this.name,
				car_info: this.vehInfo,
				phone: this.mobilePhnNum,
			};
			const res = await this.$u.post('api/user/car_collocation ', obj);
			uni.navigateTo({
				url: '../tuoguan/tuoguan',
			});
			
			uni.$showMsg(res.msg);
		},
	},
};
</script>

<style lang="scss" scoped>
.content {
	width: 100vw;
	height: 100vh;
	overflow: scroll;
	padding: 30rpx;
	.info {
		width: 690rpx;
		//height: 689rpx;
		background: #2a2929;
		box-shadow: 0rpx 0rpx 18rpx 0rpx rgba(51, 51, 51, 0.1);
		border-radius: 20rpx;
		padding: 25rpx 31rpx 31rpx 31rpx;
		margin: 0 auto;

		.info1 {
			display: flex;
			flex-direction: column;
			justify-content: center;
			height: 131rpx;
			// margin-left: 29rpx;
			border-bottom: 2rpx solid #f1eded;

			text {
				font-size: 36rpx;
				font-family: 'Microsoft YaHei', PingFang SC;
				font-weight: 400;
				color: #ffffff;
			}

			text:before {
				content: '*';
				color: #ff0000;
			}

			.inputStyle {
				font-size: 30rpx;
				font-family: 'Microsoft YaHei', PingFang SC;
				font-weight: 400;
				color: #ffffff;
			}
			input {
				color: #ffffff;
				padding-left: 10rpx;
			}
		}
	}

	.idCrd {
		width: 690rpx;
		//height: 300rpx;
		background: #2a2929;
		border-radius: 20rpx;
		padding: 30rpx;
		margin-top: 20rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		.ddd {
			display: flex;
			//justify-content: flex-start;
			flex-wrap: wrap;
			//padding: 0  30rpx;
			image {
				width: 100%;
				height: 100%;
			}
			.image {
				width: 250rpx;
				height: 180rpx;
				border: 1rpx dashed #606266;
				border-radius: 10rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				margin-left: 40rpx;
				margin-bottom: 20rpx;
			}
		}
		text {
			height: 34rpx;
			line-height: 34rpx;
			font-size: 36rpx;
			font-family: 'Microsoft YaHei', PingFang SC;
			font-weight: 400;
			color: #ffffff;
		}
		text:before {
			content: '*';
			color: #ff0000;
		}
		/deep/ .u-list-item {
			background: none !important;
			border: 1rpx dashed #606266;
			margin-right: 30rpx !important;
		}
		/deep/ .u-upload {
			// display: flex !important;
			// justify-content: space-between !important;
		}
	}
	.confirmUpload {
		margin: 0 auto;
		margin-top: 99rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 690rpx;
		height: 100rpx;
		background: #d60000;
		border-radius: 50rpx;

		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #ffffff;
	}
}
</style>
